package cn.zhentao.service.Impl;

import cn.zhentao.dao.CommentDao;
import cn.zhentao.pojo.Comment;
import cn.zhentao.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
@Autowired
    private CommentDao commentDao;
    @Override
    public void addcom(Comment comment) {
        commentDao.addcom(comment);
    }

    @Override
    public int delcom(Integer [] cid) {
        int a=0;
        for (Integer i : cid) {
            a = commentDao.delcom(i);
        }
        return a;
    }

    @Override
    public List<Comment> findc(String com) {
        List<Comment> findc = commentDao.findc(com);
        return findc;
    }

    @Override
    public List<Comment> finda() {
        List<Comment> finda = commentDao.finda();
        return finda;
    }

    @Override
    public void del(Integer cid) {
        commentDao.del(cid);
    }

    @Override
    public List<Comment> findu(Integer uid) {
        List<Comment> findu = commentDao.findu(uid);
        return findu;
    }
}
